Incorrect default LD_LIBRARY_PATH
Metadata
Current evaluation
No evaluation has been recorded for this issue yet.
Issue body
Given the following YAML:
```yaml
name: env-bug
base: core22
version: '0.1'
summary: foo
description: bar
grade: devel
confinement: strict
apps:
hello-world:
environment:
plain: $LD_LIBRARY_PATH
bracketed: ${LD_LIBRARY_PATH}
prepended: foo:${LD_LIBRARY_PATH}
complex: ${LD_LIBRARY_PATH:-Foo}
snapcrafts: ${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
command: echo
parts:
my-part:
plugin: nil
override-build: |
touch ${CRAFT_PART_INSTALL}/foo
chmod 555 ${CRAFT_PART_INSTALL}/foo
```
Snapcraft sets the default top-level `environment.LD_LIBRARY_PATH` to:
```yaml
# snap/meta.yaml
environment
LD_LIBRARY_PATH: ${SNAP_LIBRARY_PATH}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
```
But there's no shell to interpret that expansion:
```shell
$ snap run --shell my-snap-name.hello-world -c "printenv plain"
/var/lib/snapd/lib/gl:/var/lib/snapd/lib/gl32:/var/lib/snapd/void
$ snap run --shell my-snap-name.hello-world -c "printenv bracketed"
/var/lib/snapd/lib/gl:/var/lib/snapd/lib/gl32:/var/lib/snapd/void
$ snap run --shell my-snap-name.hello-world -c "printenv prepended"
foo:/var/lib/snapd/lib/gl:/var/lib/snapd/lib/gl32:/var/lib/snapd/void
$ snap run --shell my-snap-name.hello-world -c "printenv complex"
$ snap run --shell my-snap-name.hello-world -c "printenv snapcrafts"
$
```
As far I can tell, there's only simple string replacement happening.
Evaluation history
No evaluation history available.